import tensorflow as tf
import os

# 如果需要过滤警告信息，则使用如下语句
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'

g = tf.Graph()
with g.as_default():
    hello = tf.constant('Hello, TensorFlow!')
    sess = tf.compat.v1.Session(graph=g)
    print(sess.run(hello))
